package com.meituan.stock.biz.model.converter;

import com.meituan.stock.biz.model.bo.StockBO;
import com.meituan.stock.dao.model.StockDO;
import com.meituan.stock.infra.model.DeletedEnum;

/**
 * @author ShenWenhao
 * @Created by ShenWenhao
 * @Date 2022/5/9 17:08
 */
public class StockBOConverter {

    public static StockBO fromDO(StockDO stockDO){
        StockBO stockBO = new StockBO();
        stockBO.setId(stockDO.getId());
        stockBO.setGoodId(stockDO.getGoodId());
        stockBO.setWarehouseId(stockDO.getWarehouseId());
        stockBO.setMoney(stockDO.getMoney());
        stockBO.setAccount(stockDO.getAccount());
        stockBO.setDeleted(DeletedEnum.valueOf(stockDO.getDeleted()));
        return stockBO;
    }

}
